Skip to content

fix(store): stop finished orchestrations from using up the loop limit - #215

Merged
trvon merged 1 commit into
feat/workflow-swarm-viewfrom
fix/finished-swarms-loop-limit
Nov 20, 2026
Merged

trvon merged 1 commit into
feat/workflow-swarm-viewfrom
fix/finished-swarms-loop-limit

Conversation

@trvon

@trvon trvon commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Classification

Reproduced bug. Completed and cancelled orchestrations are retained for inspection and each one counted toward the 25-loop limit, so a session that had finished 25 swarms could create nothing more.

Contract

  • The 25-loop limit counts every stored loop except orchestrations whose status is completed or cancelled.
  • At most 100 finished orchestrations are retained. Past that, creating an orchestration is refused with: Maximum of 100 finished orchestrations retained. Delete some with LoopDelete before creating new ones.

Invariants

  • A running orchestration, and one that needs attention, still count (L2).
  • The retained-results bound blocks only new orchestrations; other loop kinds are unaffected (L3 control).
  • The existing limit test for ordinary loops is unchanged and passes.
  • Nothing is deleted automatically.

Evidence

Red on unchanged source: L1, L2 and L3 all failed with Maximum of 25 loops reached. Delete some before creating new ones.

Green: npm run lint, npm run typecheck, npm test (1627 passed), npm run build, npm run test:package, npm audit --audit-level=moderate, git diff --check, all by exit code. FC_NUM_RUNS=10000 over the store and orchestration-status properties: 4/4 passed.

Limitations

  • The tests finish a batch by setting its stored status, as the existing widget test does; they do not drive the orchestration reducer.
  • 100 is a chosen bound, not a measured one. A finished batch holds up to 32 items with bounded results, and all of them live in the session file until deleted or expired (seven days by default).

Completed and cancelled orchestrations are kept so their results can be
read, and each counted toward the 25-loop limit. A phased run starts
one batch per phase, so a few runs in a session ended in "Maximum of
25 loops reached" with nothing still running.

The limit now counts only controllers that can still act. Retained
finished batches get their own bound of 100; past it, a new
orchestration is refused with LoopDelete as the next action.
@trvon
trvon added this pull request to stack #210 November 20, 2026 00:41
@trvon
trvon marked this pull request as ready for review November 20, 2026 03:22
@trvon
trvon merged commit 9fb2a55 into master Nov 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant